﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ProductTypeInput.ascx.cs" Inherits="admin_webparts_Plug_ins_Product_ProductTypeInput" %>

<%@ Import Namespace="NTTHAO.Common.BL" %>
<%@ Import Namespace="NTTHAO.Web.BL.Product" %>
<%@ Import Namespace="NTTHAO.CommonWeb" %>

<script type="text/javascript">
NTTHAO.namespace('page');

NTTHAO.page.langText = [];
NTTHAO.page.langText['INVALID_IMAGE_FILE'] = '<%=LanguageUtility.GetLanguageText("INVALID_IMAGE_FILE", Session)%>';
NTTHAO.page.langText['BLANK_NAME'] = '<%=LanguageUtility.GetLanguageText("BLANK_NAME", Session)%>';
NTTHAO.page.langText['BLANK_URL'] = '<%=LanguageUtility.GetLanguageText("BLANK_URL", Session)%>';

var imageEx = '<%=NTTHAO.CommonWeb.Constant.IMAGE_FILE_EXTENTIONS %>'.split(' ');

function doSubmit() {
    var txtName = document.getElementById("<%=this.txtName.ClientID %>");
    var fuPresentativeImage = document.getElementById("<%=this.fuPresentativeImage.ClientID %>");
    var chkUseURL = document.getElementById("<%=this.chkUseURL.ClientID %>");
    var txtURL = document.getElementById("<%=this.txtURL.ClientID %>");
    
    var errorMessage = "";

    errorMessage = CheckFieldString("noblank", txtName, NTTHAO.page.langText['BLANK_NAME']);
    if(errorMessage != "")
    {
        alert(errorMessage);
        txtName.select();
        txtName.focus();
        return false;
    }
    var imgFileName = Trim(fuPresentativeImage.value);
    if (!checkFileType(imgFileName, imageEx)) {
        alert(NTTHAO.page.langText['INVALID_IMAGE_FILE']);
        fuPresentativeImage.focus();
        return false;
    }
    if(chkUseURL.checked) {
        errorMessage = CheckFieldString("noblank", txtURL, NTTHAO.page.langText['BLANK_URL']);
        if(errorMessage != "")
        {
            alert(errorMessage);
            txtURL.select();
            txtURL.focus();
            return false;
        }
    }
    /*
    errorMessage = CheckFieldString("noblank", txtViewType, NTTHAO.page.langText['INVALID_NUMBER']);
    errorMessage += CheckFieldString("integer", txtViewType, NTTHAO.page.langText['INVALID_NUMBER']);
    if(errorMessage != "")
    {
        alert(errorMessage);
        txtViewType.select();
        txtViewType.focus();
        return false;
    }
    */
    return true;
}
</script>
<script type="text/javascript">
function changeNumOfImage(num) {
    num = eval(num);
    for (var i = 1; i <= num; i++) {
        document.getElementById('trImg' + i).style.display='';
    }
    for (var i = num + 1; i <= 5; i++) {
        document.getElementById('trImg' + i).style.display='none';
    }
    onWindowResize();
}
function changeNumOfProp(num) {
    num = eval(num);
    for (var i = 1; i <= num; i++) {
        document.getElementById('trProp' + i).style.display='';
    }
    for (var i = num + 1; i <= 10; i++) {
        document.getElementById('trProp' + i).style.display='none';
    }
    onWindowResize();
}
function changePropType(index, value) {
    var trNameColl = 'trProp' + index + 'TypeColl';
    var trNameMulti = 'trProp' + index + 'TypeMulti';
    document.getElementById(trNameColl).style.display = (value == 2 ? '' : 'none');
    document.getElementById(trNameMulti).style.display = (value == 3 ? '' : 'none');
    onWindowResize();
}

YAHOO.util.Event.onDOMReady(function() {
    changeNumOfImage(document.getElementById('<%=cmbNumberOfImage.ClientID %>').value);
    changeNumOfProp(document.getElementById('<%=cmbNumberOfProperty.ClientID %>').value);
    changePropType(1, document.getElementById('<%=cmbProp1Type.ClientID %>').value);
    changePropType(2, document.getElementById('<%=cmbProp2Type.ClientID %>').value);
    changePropType(3, document.getElementById('<%=cmbProp3Type.ClientID %>').value);
    changePropType(4, document.getElementById('<%=cmbProp4Type.ClientID %>').value);
    changePropType(5, document.getElementById('<%=cmbProp5Type.ClientID %>').value);
    changePropType(6, document.getElementById('<%=cmbProp6Type.ClientID %>').value);
    changePropType(7, document.getElementById('<%=cmbProp7Type.ClientID %>').value);
    changePropType(8, document.getElementById('<%=cmbProp8Type.ClientID %>').value);
    changePropType(9, document.getElementById('<%=cmbProp9Type.ClientID %>').value);
    changePropType(10, document.getElementById('<%=cmbProp10Type.ClientID %>').value);
});
</script>
<style type="text/css">
    #spCancel1, #spSave, #spCancel2, #spSave2, #spLinkView {font-size:1.1em; font-weight: bold; }
    #spCancel1 button, #spSave button, #spCancel2 button, #spSave2 button, #spLinkView button { font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: bold; }
</style>
<div class="tip">
	<h2 style="padding-top: 2px;"><%=LanguageUtility.GetLanguageText("PRODUCT_TYPE_INPUT", Session)%></h2>
</div>
<form id="frmInput" runat="server" onsubmit="return doSubmit();">
<p style="text-align: left;">
    <span id="spSave" class="yui-button yui-link-button yuibtn yuibtn-icon btnsave"><span class="first-child"><asp:Button ID="btnSave" runat="server" OnClick="btnSave_Click" Text="Save" /></span></span>
    <span id="spCancel1" class="yui-button yui-link-button yuibtn yuibtn-icon btncancel"><span class="first-child"><a href="?action=view&g=<%=Request.QueryString["g"] %>&typeid=<%=Request.QueryString["typeid"] %>"><%=LanguageUtility.GetLanguageText("CANCEL", Session)%></a></span></span>
    <script type="text/javascript">
        YAHOO.util.Event.onContentReady("spSave", function () {
            var spSave = new YAHOO.widget.Button("spSave");
        });
        YAHOO.util.Event.onContentReady("spCancel1", function () {
            var spCancel1 = new YAHOO.widget.Button("spCancel1");
        });
    </script>
</p>
<table cellspacing="0" cellpadding="3" border="1" class="grid" style="margin: 10px auto;">
    <tr class="even">
        <td align="right" width="200px"><%=LanguageUtility.GetLanguageText("NAME", Session)%>:</td>
        <td><asp:TextBox ID="txtName" runat="server" Width="400px"></asp:TextBox></td>
    </tr>
    <tr class="odd">
        <td align="right"><%=LanguageUtility.GetLanguageText("DESCRIPTION", Session)%>:</td>
        <td><asp:TextBox ID="txtDescription" runat="server" Width="400px" Height="100px" TextMode="MultiLine"></asp:TextBox></td>
    </tr>
    <tr class="even">
        <td align="right"><%=LanguageUtility.GetLanguageText("PRESENTATIVE_IMAGE", Session)%>:</td>
        <td>
            <asp:FileUpload ID="fuPresentativeImage" runat="server" />
            &nbsp;<div style="color: mediumblue; background-color: moccasin; padding: 3px 10px 3px 10px; display: inline;"><%=Constant.IMAGE_FILE_EXTENTIONS%></div>
        </td>
    </tr>
    <%if (this._Type != null)
      { %>
    <tr class="even">
        <td align="right"><%=LanguageUtility.GetLanguageText("CURRENT_IMAGE", Session)%>:</td>
        <td><%if (this._Type.RepresentativeImage.Length > 0)
              { %>
            <img alt="" src="../resources/uploaded/product/type/<%=this._Type.ID.ToString() + "/" + this._Type.RepresentativeImage %>" style="max-width: 200px; max-height: 150px;" />
            <%}
              else
              { %><%=LanguageUtility.GetLanguageText("NONE", Session)%>
            <%} %>
        </td>
    </tr>
    <%} %>
    <tr class="odd">
        <td align="right"><%=LanguageUtility.GetLanguageText("ACTIVE", Session)%>:</td>
        <td>
            <asp:CheckBox ID="chkActive" runat="server" Text="Active" Checked="true" /></td>
    </tr>
    <tr class="even" style="height: 32px; display:<%=_IsAdmin?"":"none" %>">
        <td colspan="2"><b>For admin</b></td>
    </tr>
    <tr class="odd">
        <td align="right"><%=LanguageUtility.GetLanguageText("CONTENT_TYPE", Session)%>:</td>
        <td>
            <asp:DropDownList runat="server" ID="cmbContentType" Width="200px">
            </asp:DropDownList>
        </td>
    </tr>
    <tr class="even" style="display: none;" id="trHyperlink">
        <td align="right">
            <%=LanguageUtility.GetLanguageText("HYPERLINK", Session)%>:</td>
        <td>
            <asp:TextBox ID="txtContentURL" runat="server" Width="400px"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd" style="display:<%=_IsAdmin?"":"none" %>">
        <td align="right"><%=LanguageUtility.GetLanguageText("TARGET", Session)%>:</td>
        <td>
            <asp:DropDownList runat="server" ID="cmbContentTarget" Width="200px">
                <asp:ListItem Value="_self">Self</asp:ListItem>
                <asp:ListItem Value="_blank">Blank</asp:ListItem>
                <asp:ListItem Value="_parent">Parent</asp:ListItem>
                <asp:ListItem Value="_top">Top</asp:ListItem>
            </asp:DropDownList>
        </td>
    </tr>
    <tr class="even" style="display:<%=_IsAdmin?"":"none" %>">
        <td align="right"><%=LanguageUtility.GetLanguageText("USE_URL", Session)%>:</td>
        <td><asp:CheckBox ID="chkUseURL" runat="server" Text="Yes" Checked="false" /></td>
    </tr>
    <tr class="odd" style="display:<%=_IsAdmin?"":"none" %>">
        <td align="right"><%=LanguageUtility.GetLanguageText("URL", Session)%>:</td>
        <td>
            <asp:TextBox ID="txtURL" runat="server" Width="400px"></asp:TextBox>
        </td>
    </tr>
</table>
<script type="text/javascript">
    function showHideConfig(o) {
        if (YAHOO.util.Dom.getStyle('tbConfig', 'display') == 'table') {
            YAHOO.util.Dom.setStyle('tbConfig', 'display', 'none'); 
            o.innerText = '<%=LanguageUtility.GetLanguageText("DETAIL", Session)%>';
            YAHOO.util.Dom.removeClass(o.parentNode.parentNode, 'collapse');
            YAHOO.util.Dom.addClass(o.parentNode.parentNode, 'expand');
        } else {
            YAHOO.util.Dom.setStyle('tbConfig', 'display', 'table'); 
            o.innerText = '<%=LanguageUtility.GetLanguageText("HIDE_DETAIL", Session)%>';
            YAHOO.util.Dom.removeClass(o.parentNode.parentNode, 'expand');
            YAHOO.util.Dom.addClass(o.parentNode.parentNode, 'collapse');
            //collapse expand
        }
        onWindowResize();
    }
</script>
<div class="tip" style="<%=_IsAdmin ? "" : "display: none;" %>">
    <div style=" width: 300px; clear: left; float: left;">
    	<h2 style="padding-top: 2px;"><%=LanguageUtility.GetLanguageText("PRODUCT_TYPE_CONFIG_INPUT", Session)%></h2>
    </div>
    <div style="margin-left: 310px; text-align: right;">
        <span id="spLinkView" class="yui-button yui-link-button expand"><span class="first-child"><a href="javascript: return false;" onclick="javascript: showHideConfig(this); return false;">Chi tiết</a></span></span>
    </div>
    <script type="text/javascript">
        YAHOO.util.Event.onContentReady("spLinkView", function () {
            var spLinkView = new YAHOO.widget.Button("spLinkView");
        });
    </script>
</div>
<table id="tbConfig" cellspacing="0" cellpadding="3" border="1" class="grid" style="margin: 10px auto; display: none;">
    <tr class="even">
        <td align="right">Hiển thị đơn vị tính:</td>
        <td><input type="checkbox" id="chkUnitVisible" runat="server" checked="checked" /></td>
    </tr>
    <tr class="odd">
        <td align="right">Hiển thị giảm giá:</td>
        <td><input type="checkbox" id="chkSaleOffVisible" runat="server" /></td>
    </tr>
    <tr class="even">
        <td align="right">Hiển thị hết hàng:</td>
        <td><input type="checkbox" id="chkSoldOutVisible" runat="server" /></td>
    </tr>
    <tr class="odd">
        <td align="right"><%=LanguageUtility.GetLanguageText("PRESENTATIVE_IMAGE", Session)%>:</td>
        <td>
            <asp:TextBox ID="txtPresentativeImage" runat="server" Width="400px"></asp:TextBox>
        </td>
    </tr>
    <tr class="even">
        <td align="right">Tự resize hình đại diện:</td>
        <td><input type="checkbox" id="chkAutoResizePreImage" runat="server" /></td>
    </tr>
    <tr class="odd">
        <td align="right">Chiều rộng hình đại diện (pixel):</td>
        <td>
            <asp:TextBox ID="txtMaxPreImageWidth" runat="server" Width="146px" Text="160"></asp:TextBox>
        </td>
    </tr>
    <tr class="even">
        <td align="right">Chiều cao hình đại diện (pixel):</td>
        <td>
            <asp:TextBox ID="txtMaxPreImageHeight" runat="server" Width="146px" Text="120"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd">
        <td align="right">Cách resize hình đại diện:</td>
        <td>
            <select id="cmbPreImageResizeOption" runat="server" style="width: 150px;">
                <option value="1">FillTopLeft</option>
                <option value="2">FillCenter</option>
                <option value="3">FillBottomRight</option>
                <option value="4">FitWidth</option>
                <option value="5">FitHeight</option>
                <option value="6">AutoFix</option>
                <option value="7">CenterCanvas</option>
                <option value="8">Stretch</option>
                <option value="9">Tile</option>
                <option value="10">Center</option>
                <option value="11" selected="selected">MaximumSizeFix</option>
            </select>
        </td>
    </tr>
    <tr class="even">
        <td align="right">Màu nền hình đại diện:</td>
        <td>
            <b>#</b><asp:TextBox ID="txtPreImageBackColor" runat="server" Width="137px" Text="FFFFFF" MaxLength="6"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd">
        <td align="right">Tự resize hình sản phẩm:</td>
        <td><input type="checkbox" id="chkAutoResize" runat="server" /></td>
    </tr>
    <tr class="even">
        <td align="right">Chiều rộng hình sản phẩm (pixel):</td>
        <td>
            <asp:TextBox ID="txtMaxImageWidth" runat="server" Width="146px" Text="1024"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd">
        <td align="right">Chiều cao hình sản phẩm (pixel):</td>
        <td>
            <asp:TextBox ID="txtMaxImageHeight" runat="server" Width="146px" Text="1024"></asp:TextBox>
        </td>
    </tr>
    <tr class="even">
        <td align="right">Cách resize hình sản phẩm:</td>
        <td>
            <select id="cmbImageResizeOption" runat="server" style="width: 150px;">
                <option value="1">FillTopLeft</option>
                <option value="2">FillCenter</option>
                <option value="3">FillBottomRight</option>
                <option value="4">FitWidth</option>
                <option value="5">FitHeight</option>
                <option value="6">AutoFix</option>
                <option value="7">CenterCanvas</option>
                <option value="8">Stretch</option>
                <option value="9">Tile</option>
                <option value="10">Center</option>
                <option value="11" selected="selected">MaximumSizeFix</option>
            </select>
        </td>
    </tr>
    <tr class="odd">
        <td align="right">Màu nền hình sản phẩm:</td>
        <td>
            <b>#</b><asp:TextBox ID="txtImageBackColor" runat="server" Width="137px" Text="FFFFFF" MaxLength="6"></asp:TextBox>
        </td>
    </tr>
    <tr class="even">
        <td align="right">Tự tạo hình thumbnail:</td>
        <td><input type="checkbox" id="chkCreateMiniImage" runat="server" checked="checked" /></td>
    </tr>
    <tr class="odd">
        <td align="right">Chiều rộng hình thumbnail (pixel):</td>
        <td>
            <asp:TextBox ID="txtMiniImageWidth" runat="server" Width="146px" Text="160"></asp:TextBox>
        </td>
    </tr>
    <tr class="even">
        <td align="right">Chiều cao hình thumbnail (pixel):</td>
        <td>
            <asp:TextBox ID="txtMiniImageHeight" runat="server" Width="146px" Text="120"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd">
        <td align="right">Cách resize hình thumbnail:</td>
        <td>
            <select id="cmbMiniImageResizeOption" runat="server" style="width: 150px;">
                <option value="1">FillTopLeft</option>
                <option value="2">FillCenter</option>
                <option value="3">FillBottomRight</option>
                <option value="4">FitWidth</option>
                <option value="5">FitHeight</option>
                <option value="6">AutoFix</option>
                <option value="7">CenterCanvas</option>
                <option value="8">Stretch</option>
                <option value="9">Tile</option>
                <option value="10">Center</option>
                <option value="11" selected="selected">MaximumSizeFix</option>
            </select>
        </td>
    </tr>
    <tr class="even">
        <td align="right">Màu nền hình thumbnail:</td>
        <td>
            <b>#</b><asp:TextBox ID="txtMiniImageBackColor" runat="server" Width="137px" Text="FFFFFF" MaxLength="6"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd">
        <td align="right" width="200px"><%=LanguageUtility.GetLanguageText("NUMBER_OF_IMAGE", Session)%>:</td>
        <td>
            <select id="cmbNumberOfImage" runat="server" style="width: 100px;" onchange="changeNumOfImage(this.value);">
                <option value="0">0</option>
                <option value="1">1</option>
                <option value="2">2</option>
                <option value="3">3</option>
                <option value="4" selected="selected">4</option>
                <option value="5">5</option>
                <option value="6">6</option>
                <option value="7">7</option>
                <option value="8">8</option>
                <option value="9">9</option>
                <option value="10">10</option>
            </select>
        </td>
    </tr>
    <tr class="even" id="trImg1">
        <td align="right"><%=LanguageUtility.GetLanguageText("IMAGE", Session)%> 1:</td>
        <td>
            <asp:TextBox ID="txtImage1" runat="server" Width="400px"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd" id="trImg2">
        <td align="right"><%=LanguageUtility.GetLanguageText("IMAGE", Session)%> 2:</td>
        <td>
            <asp:TextBox ID="txtImage2" runat="server" Width="400px"></asp:TextBox>
        </td>
    </tr>
    <tr class="even" id="trImg3">
        <td align="right"><%=LanguageUtility.GetLanguageText("IMAGE", Session)%> 3:</td>
        <td>
            <asp:TextBox ID="txtImage3" runat="server" Width="400px"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd" id="trImg4">
        <td align="right"><%=LanguageUtility.GetLanguageText("IMAGE", Session)%> 4:</td>
        <td>
            <asp:TextBox ID="txtImage4" runat="server" Width="400px"></asp:TextBox>
        </td>
    </tr>
    <tr class="even" id="trImg5" style="display: none;">
        <td align="right"><%=LanguageUtility.GetLanguageText("IMAGE", Session)%> 5:</td>
        <td>
            <asp:TextBox ID="txtImage5" runat="server" Width="400px"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd" id="trImg6" style="display: none;">
        <td align="right"><%=LanguageUtility.GetLanguageText("IMAGE", Session)%> 6:</td>
        <td>
            <asp:TextBox ID="txtImage6" runat="server" Width="400px"></asp:TextBox>
        </td>
    </tr>
    <tr class="even" id="trImg7" style="display: none;">
        <td align="right"><%=LanguageUtility.GetLanguageText("IMAGE", Session)%> 7:</td>
        <td>
            <asp:TextBox ID="txtImage7" runat="server" Width="400px"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd" id="trImg8" style="display: none;">
        <td align="right"><%=LanguageUtility.GetLanguageText("IMAGE", Session)%> 8:</td>
        <td>
            <asp:TextBox ID="txtImage8" runat="server" Width="400px"></asp:TextBox>
        </td>
    </tr>
    <tr class="even" id="trImg9" style="display: none;">
        <td align="right"><%=LanguageUtility.GetLanguageText("IMAGE", Session)%> 9:</td>
        <td>
            <asp:TextBox ID="txtImage9" runat="server" Width="400px"></asp:TextBox>
        </td>
    </tr>
    <tr class="odd" id="trImg10" style="display: none;">
        <td align="right"><%=LanguageUtility.GetLanguageText("IMAGE", Session)%> 10:</td>
        <td>
            <asp:TextBox ID="txtImage10" runat="server" Width="400px"></asp:TextBox>
        </td>
    </tr>
    <tr class="even">
        <td align="right"><%=LanguageUtility.GetLanguageText("NUMBER_OF_PROPERTY", Session)%>:</td>
        <td>
            <select id="cmbNumberOfProperty" runat="server" style="width: 100px;" onchange="changeNumOfProp(this.value);">
                <option value="0">0</option>
                <option value="1">1</option>
                <option value="2">2</option>
                <option value="3">3</option>
                <option value="4">4</option>
                <option value="5">5</option>
                <option value="6">6</option>
                <option value="7">7</option>
                <option value="8">8</option>
                <option value="9">9</option>
                <option value="10" selected="selected">10</option>
            </select>
        </td>
    </tr>
    <tr class="odd" id="trProp1">
        <td align="right"><%=LanguageUtility.GetLanguageText("PROPERTY", Session)%> 1:</td>
        <td>
            <table cellspacing="0" cellpadding="3" border="1" class="grid">
                <tr class="odd">
                    <td style="width: 100px;"><%=LanguageUtility.GetLanguageText("NAME", Session)%>: </td>
                    <td><asp:TextBox ID="txtProperty1" runat="server" Width="310px"></asp:TextBox></td>
                </tr>
                <tr>
                    <td><%=LanguageUtility.GetLanguageText("TYPE", Session)%>: </td>
                    <td>
                        <select id="cmbProp1Type" runat="server" style="width: 100px;" onchange="changePropType(1, this.value);">
                            <option value="1">Text</option>
                            <option value="2">Collection</option>
                        </select>
                    </td>
                </tr>
                <tr id="trProp1TypeColl" style="display: none;">
                    <td>Collection: </td>
                    <td>
                        <select id="cmbProp1TypeColl" runat="server">
                        </select>
                    </td>
                </tr>
                <tr id="trProp1TypeMulti" style="display: none;">
                    <td>Value type: </td>
                    <td>
                        <select id="cmbProp1TypeMulti" runat="server">
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>Giá trị mặc định:</td>
                    <td>
                        <asp:TextBox ID="txtProp1DefaultValue" runat="server" Width="310px"></asp:TextBox>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr class="even" id="trProp2">
        <td align="right"><%=LanguageUtility.GetLanguageText("PROPERTY", Session)%> 2:</td>
        <td>
            <table cellspacing="0" cellpadding="3" border="1" class="grid">
                <tr class="even">
                    <td style="width: 100px;"><%=LanguageUtility.GetLanguageText("NAME", Session)%>: </td>
                    <td><asp:TextBox ID="txtProperty2" runat="server" Width="310px"></asp:TextBox></td>
                </tr>
                <tr class="even">
                    <td><%=LanguageUtility.GetLanguageText("TYPE", Session)%>: </td>
                    <td>
                        <select id="cmbProp2Type" runat="server" style="width: 100px;" onchange="changePropType(2, this.value);">
                            <option value="1">Text</option>
                            <option value="2">Collection</option>
                        </select>
                    </td>
                </tr>
                <tr class="even" id="trProp2TypeColl" style="min-width: 100px;display: none;">
                    <td>Collection: </td>
                    <td>
                        <select id="cmbProp2TypeColl" runat="server">
                        </select>
                    </td>
                </tr>
                <tr id="trProp2TypeMulti" style="display: none;">
                    <td>Value type: </td>
                    <td>
                        <select id="cmbProp2TypeMulti" runat="server">
                        </select>
                    </td>
                </tr>
                <tr class="even">
                    <td>Giá trị mặc định:</td>
                    <td>
                        <asp:TextBox ID="txtProp2DefaultValue" runat="server" Width="310px"></asp:TextBox>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr class="odd" id="trProp3">
        <td align="right"><%=LanguageUtility.GetLanguageText("PROPERTY", Session)%> 3:</td>
        <td>
            <table cellspacing="0" cellpadding="3" border="1" class="grid">
                <tr>
                    <td style="width: 100px;"><%=LanguageUtility.GetLanguageText("NAME", Session)%>: </td>
                    <td><asp:TextBox ID="txtProperty3" runat="server" Width="310px"></asp:TextBox></td>
                </tr>
                <tr>
                    <td><%=LanguageUtility.GetLanguageText("TYPE", Session)%>: </td>
                    <td>
                        <select id="cmbProp3Type" runat="server" style="width: 100px;" onchange="changePropType(3, this.value);">
                            <option value="1">Text</option>
                            <option value="2">Collection</option>
                        </select>
                    </td>
                </tr>
                <tr id="trProp3TypeColl" style="min-width: 100px;display: none;">
                    <td>Collection: </td>
                    <td>
                        <select id="cmbProp3TypeColl" runat="server">
                        </select>
                    </td>
                </tr>
                <tr id="trProp3TypeMulti" style="display: none;">
                    <td>Value type: </td>
                    <td>
                        <select id="cmbProp3TypeMulti" runat="server">
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>Giá trị mặc định:</td>
                    <td>
                        <asp:TextBox ID="txtProp3DefaultValue" runat="server" Width="310px"></asp:TextBox>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr class="even" id="trProp4">
        <td align="right"><%=LanguageUtility.GetLanguageText("PROPERTY", Session)%> 4:</td>
        <td>
            <table cellspacing="0" cellpadding="3" border="1" class="grid">
                <tr class="even">
                    <td style="width: 100px;"><%=LanguageUtility.GetLanguageText("NAME", Session)%>: </td>
                    <td><asp:TextBox ID="txtProperty4" runat="server" Width="310px"></asp:TextBox></td>
                </tr>
                <tr class="even">
                    <td><%=LanguageUtility.GetLanguageText("TYPE", Session)%>: </td>
                    <td>
                        <select id="cmbProp4Type" runat="server" style="width: 100px;" onchange="changePropType(4, this.value);">
                            <option value="1">Text</option>
                            <option value="2">Collection</option>
                        </select>
                    </td>
                </tr>
                <tr class="even" id="trProp4TypeColl" style="min-width: 100px;display: none;">
                    <td>Collection: </td>
                    <td>
                        <select id="cmbProp4TypeColl" runat="server">
                        </select>
                    </td>
                </tr>
                <tr id="trProp4TypeMulti" style="display: none;">
                    <td>Value type: </td>
                    <td>
                        <select id="cmbProp4TypeMulti" runat="server">
                        </select>
                    </td>
                </tr>
                <tr class="even">
                    <td>Giá trị mặc định:</td>
                    <td>
                        <asp:TextBox ID="txtProp4DefaultValue" runat="server" Width="310px"></asp:TextBox>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr class="odd" id="trProp5">
        <td align="right"><%=LanguageUtility.GetLanguageText("PROPERTY", Session)%> 5:</td>
        <td>
            <table cellspacing="0" cellpadding="3" border="1" class="grid">
                <tr>
                    <td style="width: 100px;"><%=LanguageUtility.GetLanguageText("NAME", Session)%>: </td>
                    <td><asp:TextBox ID="txtProperty5" runat="server" Width="310px"></asp:TextBox></td>
                </tr>
                <tr>
                    <td><%=LanguageUtility.GetLanguageText("TYPE", Session)%>: </td>
                    <td>
                        <select id="cmbProp5Type" runat="server" style="width: 100px;" onchange="changePropType(5, this.value);">
                            <option value="1">Text</option>
                            <option value="2">Collection</option>
                        </select>
                    </td>
                </tr>
                <tr id="trProp5TypeColl" style="min-width: 100px;display: none;">
                    <td>Collection: </td>
                    <td>
                        <select id="cmbProp5TypeColl" runat="server">
                        </select>
                    </td>
                </tr>
                <tr id="trProp5TypeMulti" style="display: none;">
                    <td>Value type: </td>
                    <td>
                        <select id="cmbProp5TypeMulti" runat="server">
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>Giá trị mặc định:</td>
                    <td>
                        <asp:TextBox ID="txtProp5DefaultValue" runat="server" Width="310px"></asp:TextBox>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr class="even" id="trProp6">
        <td align="right"><%=LanguageUtility.GetLanguageText("PROPERTY", Session)%> 6:</td>
        <td>
            <table cellspacing="0" cellpadding="3" border="1" class="grid">
                <tr class="even">
                    <td style="width: 100px;"><%=LanguageUtility.GetLanguageText("NAME", Session)%>: </td>
                    <td><asp:TextBox ID="txtProperty6" runat="server" Width="310px"></asp:TextBox></td>
                </tr>
                <tr class="even">
                    <td><%=LanguageUtility.GetLanguageText("TYPE", Session)%>: </td>
                    <td>
                        <select id="cmbProp6Type" runat="server" style="width: 100px;" onchange="changePropType(6, this.value);">
                            <option value="1">Text</option>
                            <option value="2">Collection</option>
                        </select>
                    </td>
                </tr>
                <tr class="even" id="trProp6TypeColl" style="min-width: 100px;display: none;">
                    <td>Collection: </td>
                    <td>
                        <select id="cmbProp6TypeColl" runat="server">
                        </select>
                    </td>
                </tr>
                <tr id="trProp6TypeMulti" style="display: none;">
                    <td>Value type: </td>
                    <td>
                        <select id="cmbProp6TypeMulti" runat="server">
                        </select>
                    </td>
                </tr>
                <tr class="even">
                    <td>Giá trị mặc định:</td>
                    <td>
                        <asp:TextBox ID="txtProp6DefaultValue" runat="server" Width="310px"></asp:TextBox>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr class="odd" id="trProp7">
        <td align="right"><%=LanguageUtility.GetLanguageText("PROPERTY", Session)%> 7:</td>
        <td>
            <table cellspacing="0" cellpadding="3" border="1" class="grid">
                <tr>
                    <td style="width: 100px;"><%=LanguageUtility.GetLanguageText("NAME", Session)%>: </td>
                    <td><asp:TextBox ID="txtProperty7" runat="server" Width="310px"></asp:TextBox></td>
                </tr>
                <tr>
                    <td><%=LanguageUtility.GetLanguageText("TYPE", Session)%>: </td>
                    <td>
                        <select id="cmbProp7Type" runat="server" style="width: 100px;" onchange="changePropType(7, this.value);">
                            <option value="1">Text</option>
                            <option value="2">Collection</option>
                        </select>
                    </td>
                </tr>
                <tr id="trProp7TypeColl" style="min-width: 100px;display: none;">
                    <td>Collection: </td>
                    <td>
                        <select id="cmbProp7TypeColl" runat="server">
                        </select>
                    </td>
                </tr>
                <tr id="trProp7TypeMulti" style="display: none;">
                    <td>Value type: </td>
                    <td>
                        <select id="cmbProp7TypeMulti" runat="server">
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>Giá trị mặc định:</td>
                    <td>
                        <asp:TextBox ID="txtProp7DefaultValue" runat="server" Width="310px"></asp:TextBox>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr class="even" id="trProp8">
        <td align="right"><%=LanguageUtility.GetLanguageText("PROPERTY", Session)%> 8:</td>
        <td>
            <table cellspacing="0" cellpadding="3" border="1" class="grid">
                <tr class="even">
                    <td style="width: 100px;"><%=LanguageUtility.GetLanguageText("NAME", Session)%>: </td>
                    <td><asp:TextBox ID="txtProperty8" runat="server" Width="310px"></asp:TextBox></td>
                </tr>
                <tr class="even">
                    <td><%=LanguageUtility.GetLanguageText("TYPE", Session)%>: </td>
                    <td>
                        <select id="cmbProp8Type" runat="server" style="width: 100px;" onchange="changePropType(8, this.value);">
                            <option value="1">Text</option>
                            <option value="2">Collection</option>
                        </select>
                    </td>
                </tr>
                <tr class="even" id="trProp8TypeColl" style="min-width: 100px;display: none;">
                    <td>Collection: </td>
                    <td>
                        <select id="cmbProp8TypeColl" runat="server">
                        </select>
                    </td>
                </tr>
                <tr id="trProp8TypeMulti" style="display: none;">
                    <td>Value type: </td>
                    <td>
                        <select id="cmbProp8TypeMulti" runat="server">
                        </select>
                    </td>
                </tr>
                <tr class="even">
                    <td>Giá trị mặc định:</td>
                    <td>
                        <asp:TextBox ID="txtProp8DefaultValue" runat="server" Width="310px"></asp:TextBox>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr class="odd" id="trProp9">
        <td align="right"><%=LanguageUtility.GetLanguageText("PROPERTY", Session)%> 9:</td>
        <td>
            <table cellspacing="0" cellpadding="3" border="1" class="grid">
                <tr>
                    <td style="width: 100px;"><%=LanguageUtility.GetLanguageText("NAME", Session)%>: </td>
                    <td><asp:TextBox ID="txtProperty9" runat="server" Width="310px"></asp:TextBox></td>
                </tr>
                <tr>
                    <td><%=LanguageUtility.GetLanguageText("TYPE", Session)%>: </td>
                    <td>
                        <select id="cmbProp9Type" runat="server" style="width: 100px;" onchange="changePropType(9, this.value);">
                            <option value="1">Text</option>
                            <option value="2">Collection</option>
                        </select>
                    </td>
                </tr>
                <tr id="trProp9TypeColl" style="min-width: 100px;display: none;">
                    <td>Collection: </td>
                    <td>
                        <select id="cmbProp9TypeColl" runat="server">
                        </select>
                    </td>
                </tr>
                <tr id="trProp9TypeMulti" style="display: none;">
                    <td>Value type: </td>
                    <td>
                        <select id="cmbProp9TypeMulti" runat="server">
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>Giá trị mặc định:</td>
                    <td>
                        <asp:TextBox ID="txtProp9DefaultValue" runat="server" Width="310px"></asp:TextBox>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr class="even" id="trProp10">
        <td align="right"><%=LanguageUtility.GetLanguageText("PROPERTY", Session)%> 10:</td>
        <td>
            <table cellspacing="0" cellpadding="3" border="1" class="grid">
                <tr class="even">
                    <td style="width: 100px;"><%=LanguageUtility.GetLanguageText("NAME", Session)%>: </td>
                    <td><asp:TextBox ID="txtProperty10" runat="server" Width="310px"></asp:TextBox></td>
                </tr>
                <tr class="even">
                    <td><%=LanguageUtility.GetLanguageText("TYPE", Session)%>: </td>
                    <td>
                        <select id="cmbProp10Type" runat="server" style="width: 100px;" onchange="changePropType(10, this.value);">
                            <option value="1">Text</option>
                            <option value="2">Collection</option>
                        </select>
                    </td>
                </tr>
                <tr class="even" id="trProp10TypeColl" style="min-width: 100px;display: none;">
                    <td>Collection: </td>
                    <td>
                        <select id="cmbProp10TypeColl" runat="server">
                        </select>
                    </td>
                </tr>
                <tr id="trProp10TypeMulti" style="display: none;">
                    <td>Value type: </td>
                    <td>
                        <select id="cmbProp10TypeMulti" runat="server">
                        </select>
                    </td>
                </tr>
                <tr class="even">
                    <td>Giá trị mặc định:</td>
                    <td>
                        <asp:TextBox ID="txtProp10DefaultValue" runat="server" Width="310px"></asp:TextBox>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>
<p style="text-align: left;">
    <span id="spSave2" class="yui-button yui-link-button yuibtn yuibtn-icon btnsave"><span class="first-child"><asp:Button ID="btnSave2" runat="server" OnClick="btnSave_Click" Text="Save" /></span></span>
    <span id="spCancel2" class="yui-button yui-link-button yuibtn yuibtn-icon btncancel"><span class="first-child"><a href="?action=view&g=<%=Request.QueryString["g"] %>&typeid=<%=Request.QueryString["typeid"] %>"><%=LanguageUtility.GetLanguageText("CANCEL", Session)%></a></span></span>
    <script type="text/javascript">
        YAHOO.util.Event.onContentReady("spSave2", function () {
            var spSave2 = new YAHOO.widget.Button("spSave2");
        });
        YAHOO.util.Event.onContentReady("spCancel2", function () {
            var spCancel2 = new YAHOO.widget.Button("spCancel2");
        });
    </script>
</p>
</form>
<script type="text/javascript">
YAHOO.util.Event.onDOMReady(function() {
    document.getElementById("<%=txtName.ClientID %>").focus();
});
</script>

<script type="text/javascript">
function viewTypeChange() {
    if (document.getElementById('<%=cmbContentType.ClientID %>').value == '1') {
        document.getElementById('trHyperlink').style.display = '';
    } else {
        document.getElementById('trHyperlink').style.display = 'none';
    }
}

YAHOO.util.Event.onDOMReady(function() {
    YAHOO.util.Event.addListener("<%=cmbContentType.ClientID %>", "change", viewTypeChange);
    viewTypeChange();
});
</script>